package cn.zwx.distributed.svc.rpc.facade;

import cn.zwx.base.entity.ResponseEntity;
import cn.zwx.base.exception.BizWrapException;
import org.apache.dubbo.apidocs.annotations.RequestParam;

import javax.validation.constraints.NotBlank;

/**
 * @author zhangwenxue
 */
public interface DubboDistributedService {

    /**
     * 获取全局分布式ID
     * @return UID
     * @throws BizWrapException BizWrapException
     */
    ResponseEntity<String> getDistributedId() throws BizWrapException;

    /**
     * 解析全局分布式ID
     * @param distributedId 全局id
     * @return Parsed info
     * @throws BizWrapException 业务异常
     */
    ResponseEntity<String> parsDistributedId(@NotBlank(message = "全局id不能为空")
                                             @RequestParam(value = "全局id",required = true) String distributedId) throws BizWrapException;

}
